package name.jautzy.esi.client.ressources;


import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;

import name.jautzy.esi.client.ressources.littleicons.EsiLittleIcons;
import name.jautzy.esi.client.ressources.stdicons.EsiStdIcons;

public class StandardRessources  {
	public static final EsiStdIcons STDICONS = GWT.create(EsiStdIcons.class);
	public static final EsiLittleIcons LTLICONS = GWT.create(EsiLittleIcons.class);
	
	public static AbstractImagePrototype getIcon(ImageResource ress) {
		return AbstractImagePrototype.create(ress);
	}
	
	public static Image getImage(int id) {
		int firstPart = id/100;
		int lastPart = id%100;
		StringBuffer buff = new StringBuffer("ressources/images/32x32/");
		if (firstPart<10)
			buff.append('0');
		buff.append(firstPart);
		buff.append('_');
		if (lastPart<10)
			buff.append('0');
		buff.append(lastPart);
		buff.append(".png");
		
		return new Image(buff.toString());
		
	}

}
